package com.ogilvy.audi.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ogilvy.audi.bean.Bulletin;
import com.ogilvy.audi.dao.BulletinDao;
import com.ogilvy.audi.service.BulletinService;
import com.ogilvy.frame.service.BaseServiceImpl;
@Service
public class BulletinServiceImpl extends BaseServiceImpl implements BulletinService{
	@Autowired
	BulletinDao bulletinDao;
	public List<Bulletin> query(){
		return bulletinDao.selectAll();
	}
	public List<Bulletin> query(int pageNo, int pageSize,Map<String,Object> condition){
		return bulletinDao.selectAll(pageNo,pageSize,condition);
	}
	public List<Bulletin> query(Map<String,Object> condition){
		return bulletinDao.selectAll(condition);
	}
	public Bulletin add(Bulletin bulletin){
		return bulletinDao.save(bulletin);
	}
	public boolean del(Integer bulletinId){
		
		Bulletin bulletin = bulletinDao.deleteById(bulletinId);
		if(null!=bulletin){
			return true;
		}
		return false;
	}

}
